package com.e3.sysmg.security.model;

import com.e3.template.model.TGFTreeModel;

public class ModuleModel extends TGFTreeModel implements ModuleFields{
	/**
	 * 
	 */
	private static final long serialVersionUID = 3567391335532525077L;
	
	//模块编码，任意值，但是不能重复
	private String code;
	
	private String name;
	
	private String path;
	
	private Integer status;
	
	//隐藏字段，系统自动生成，客户无法也不能改变，不能重复。更新时该字段不更新。
	private int authCode;
	
	public ModuleModel(){
		
	}
	
	public ModuleModel(String code){
		setCode(code);
	}

	public String getCode() {
		return get(ModuleFields.CODE);
	}

	public void setCode(String code) {
		set(ModuleFields.CODE,code);
	}

	public String getName() {
		return get(ModuleFields.NAME);
	}

	public void setName(String name) {
		set(ModuleFields.NAME,name);
	}

	public Integer getStatus() {
		return getIntValue(ModuleFields.STATUS,ModuleStatus.STATUS_NORMAL);
	}

	public void setStatus(Integer status) {
		set(ModuleFields.STATUS,status);
	}

	public String getPath() {
		return get(ModuleFields.PATH);
	}

	public void setPath(String path) {
		set(ModuleFields.PATH,path);
	}

	public String toString(){
		return getName();
	}

	public String[] getModelFields() {
		return ModuleFields.fieldNames;
	}

	@Override
	public String getParentFiledName() {
		return ModuleModel.PARENT_MODULE;
	}
	
}
